//
//  EmoticonTextAttachment.swift
//  MyWeiBo
//
//  Created by mac on 15/3/13.
//  Copyright (c) 2015年 gpr. All rights reserved.
//

import UIKit

class EmoticonTextAttachment: NSTextAttachment {
   
    var emoticonString: String?
    
    class func attributedStringWithEmoticon(emoticon: Emoticon, lineHeight: CGFloat) -> NSAttributedString {
        let attachment = EmoticonTextAttachment()
        attachment.bounds = CGRectMake(0, -4, lineHeight, lineHeight)
        attachment.image = UIImage(contentsOfFile: emoticon.imagePath!)
        attachment.emoticonString = emoticon.chs
        return NSAttributedString(attachment: attachment)
    }
    
}
